package linkedList.递归;

import po.ListNode;

import java.util.concurrent.atomic.AtomicBoolean;

/**
 * @author songZiHao
 * @version 1.0.0
 * @ClassName 翻转整个链表206.java
 * @Description TODO https://leetcode-cn.com/problems/reverse-linked-list/
 * @createTime 2021年03月08日 15:08:00
 */
public class 翻转整个链表206 {

    public ListNode reverseList(ListNode head) {

        new Thread(()->{

        });
        if (head==null){
            return null;
        }
        if (head.next==null){
            return head;
        }
        ListNode last = reverseList(head.next);
        head.next.next=head;
        head.next=null;
        return last;
    }

}
